package com.example.yin.service.impl;

import com.example.yin.domain.Forum;
import com.example.yin.dao.ForumMapper;
import com.example.yin.vo.ForumVO;
import com.example.yin.service.ForumService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author music
 * @since 2023-06-21
 */
@Service
public class ForumServiceImpl implements ForumService {

    @Autowired
    private ForumMapper forumMapper;

    @Override
    public boolean addForum(Forum forum) {
        return forumMapper.insert(forum) > 0;
    }

    @Override
    public boolean deleteForum(Integer id) {
        return forumMapper.deleteForum(id) > 0;
    }

    @Override
    public boolean updateForum(Forum forum) {
        return forumMapper.updateForum(forum) > 0;
    }

    @Override
    public List<ForumVO> allForum() {
        return forumMapper.allForum();
    }
}
